package com.e3.basdoc.goods.client;

import java.util.List;

import com.e3.basdoc.goods.model.GoodsModel;
import com.e3.template.tgf.MyGFUI;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.template.tgf.TGFGridPanel;
import com.e3.template.tgf.TGFQueryDialog;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class GoodsUI extends MyGFUI<GoodsModel> {
	
	private GoodsRPCServiceAsync service = GoodsRPCService.Util.getInstance();

	@Override
	protected TGFFormPanel<GoodsModel> createFormPanel() {
		return new GoodsFormPanel();
	}

	@Override
	protected TGFGridPanel<GoodsModel> createGridPanel() {
		return new GoodsGridPanel();
	}

	@Override
	protected TGFQueryDialog<GoodsModel> createQueryDialog() {
		return new GoodsQueryDialog();
	}

	@Override
	protected TGFEditorDialog<GoodsModel> createEditorDialog() {
		return new GoodsEditorDialog();
	}

	@Override
	protected void executeDeleteService(final List<GoodsModel> models,AsyncCallback<Void> callback) {
		service.deleteGoodss(models,callback);
	}

	@Override
	protected String getCurrentLocalName() {
		return GoodsMessages.INSTANCE.local_name();
	}

	@Override
	protected GoodsModel createModelInstance() {
		return new GoodsModel();
	}

}
